﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace MaintenanceService.Common
{
    public class ExecutedTask
    {
        public Guid TaskId { get; set; }
        public DateTime DateAdded { get; set; }
        public TaskInfo TaskInfo { get; set; }
        public DateTime DateStarted { get; set; }
        public string Data { get; set; }
        public string Info { get; set; }
        public DateTime DateExecuted { get; set; }
        public string DataShort
        {
            get
            {
                if (Data.Trim().Length > 50)
                {
                    return String.Format(CultureInfo.CurrentCulture, "{0} ...", Data.Trim().Substring(0, 50));
                }
                else
                {
                    return Data.Trim();
                }
            }
        }
    }
}
